﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace MuzičkiFeršterker
{
    public partial class Form1 : Form
    {
        public Form1(string prevText, string stringtext)
        {
            InitializeComponent();
            label1.Text = stringtext;
            HEADER = prevText;
            textBox1.Text = prevText;
        }
        public string HEADER;

        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {

                this.DialogResult = DialogResult.Cancel;
            }
            else if (e.KeyCode == Keys.Enter)
            {
                HEADER = textBox1.Text.ToString();
                this.DialogResult = DialogResult.OK;
            }
        }

        private void CancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void OKButton_Click(object sender, EventArgs e)
        {
            HEADER = textBox1.Text.ToString();
            this.DialogResult = DialogResult.OK;
        }

    }
}
